package com.spa.interfaces.admin;

import cn.dev33.satoken.annotation.SaIgnore;
import com.spa.application.dto.admin.IndexDTO;
import com.spa.application.dto.admin.RankingListDTO;
import com.spa.application.service.admin.DataScreenApplicationService;
import com.spa.infrastructure.common.ResponseMessage;
import com.spa.interfaces.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("admin/dataScreen")
public class DataScreenController extends BaseController {

    @Autowired
    private DataScreenApplicationService dataScreenApplicationService;

    @PostMapping
    @SaIgnore
    public ResponseMessage<IndexDTO> index() {
        dataScreenApplicationService.index();
        return responseHelper.success();
    }

    @PostMapping("getRankingList")
    @SaIgnore
    public ResponseMessage<RankingListDTO> getRankingList() {
        return responseHelper.success(dataScreenApplicationService.getRankingList());
    }

}
